package cn.edu.scau.cmi.chenjunlin.mterProgramming.Experiment3.Example1;

public class PolicyProducer {
	public static AutoInsurance getPolicyObj(String option) {
		AutoInsurance policy = null;
		if(option.compareTo("bodyInjure") == 0) {
			policy = new BodyInjure();
		}
		else if(option.compareTo("collision") == 0) {
			policy = new Collision();
		}
		else if(option.compareTo("varied") == 0) {
			policy = new Varied();
		}
		else if(option.compareTo("personInjure") == 0) {
			policy = new PersonInjure();
		}
		return policy;
	}

}
 